home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-14 | 4.7 KB | 195 lines | [TEXT/KAHL] |
- $$Loop ModelessDialogs
- $$Message User Modeless Dialog, u:$Worksheet.name$.cp
-
- $$File u:$Worksheet.name$.cp
- /* $Worksheet.name$ Handle this dialog */
- /* $CopyRight$ */
-
- /* File name: $Worksheet.name$
- Function: Handle this modeless dialog.
-
- This dialog is called when:
-
- History: $Date$ Original by $Author$
-
- */
-
- #include "mmCommon$Prototype.name$.h" /* Common */
- #include "Common$Prototype.name$.h" /* Common */
-
- /* ======================================================= */
- /* ======================================================= */
-
- void CMD$Worksheet.name$::Init()
- {
- inherited::Init();
- }
-
- $$if Option.EXTRAHOOKS
- /* ======================================================= */
-
- /* Purpose: This procedures purpose is to open this window and set all */
- /* of the initial conditions, such as default edit text. */
-
- void CMD$Worksheet.name$::OpenExtras()
- {
- inherited::OpenExtras();
- }
-
- /* ======================================================= */
-
- /* Purpose: This procedures purpose is to refresh this window, update it, */
- /* when we are uncovered by another window. */
-
- void CMD$Worksheet.name$::UpdateExtras()
- {
- inherited::UpdateExtras();
- }
-
- /* ======================================================= */
-
- /* Purpose: This procedures purpose is to close this window and clear */
- /* the window pointer variable */
-
- void CMD$Worksheet.name$::Close(WindowPtr theWindow)
- {
-
-
- if ((this->theWindow != NIL) && (theWindow == this->theWindow))/* Only close if it is us and we were open */
- {
- }
-
- inherited::Close(theWindow);
- }
-
- /* ======================================================= */
-
- /* Routine: HandleEvent */
- /* Purpose: This procedures purpose is to handle all actions, such as buttons being pressed. */
- /* This is the real meat of this unit and is where the code is for acting upon the users actions. */
-
- void CMD$Worksheet.name$::HandleEvent(EventRecord *theEvent,WindowPtr theWindow,short itemHit)
- {
- DialogPtr theDialog;
- Point myPt; /* For the local mouse position */
- short DType; /* Type of dialog item */
- Handle DItem; /* Handle to the dialog item */
- Rect tempRect; /* Temporary rectangle */
- ControlHandle CItem; /* Control handle */
-
-
- inherited::HandleEvent(theEvent,theWindow,itemHit);
-
- $$if HasLists
- if ((theEvent->what == mouseDown) && (this->theWindow != nil))
- {
- SetPort(this->theWindow); /* Set the port to our dialog */
- myPt = theEvent->where; /* Get the position where the mouse was pressed */
- GlobalToLocal(&myPt); /* Change from global to local location */
-
- $$Loop Control.type = List
- if (PtInRect(myPt,&this->ListRect_$Control.name$))
- {
- /* List is this->List_$Control.name$ */
- }
-
- $$EndLoop Control.type
- }
- $$endif HasLists
-
- if ((this->theWindow != nil) && (this->theWindow == theWindow))
- {
- theDialog = this->theWindow;
-
- if (itemHit > 0) /* Skip if user set to zero */
- {
- GetDItem(theDialog,itemHit,&DType,&DItem,&tempRect);/* Get which item was pressed */
- CItem = (ControlHandle)DItem; /* Change the pointer for getting to the control */
- }
-
- /* Handle it real time */
- $$Loop Control.type = Button
- if (itemHit == ResD_$Control.name$) /* Handle the Button being pressed */
- {
- }
-
- $$EndLoop Control.type
- $$Loop Control.type = Checkbox
- if (itemHit == ResD_$Control.name$) /* Handle the checkbox being pressed */
- {
- if (this->Value_$Control.name$ == 0)
- {
- }
- else
- {
- }
- }
-
- $$EndLoop Control.type
- $$Loop Control.type = UButton
- if (itemHit == ResD_$Control.name$) /* Handle the Button being pressed */
- {
- }
-
- $$EndLoop Control.type
- $$Loop Control.type = UToggle
- if (itemHit == ResD_$Control.name$) /* Handle the checkbox being pressed */
- {
- if (this->Value_$Control.name$ == 0)
- {
- }
- else
- {
- }
- }
-
- $$EndLoop Control.type
- $$Loop Control.type = Radio
- if (itemHit == ResD_$Control.name$) /* Handle the Radio being pressed */
- {
- }
-
- $$EndLoop Control.type
- $$Loop Control.type = HotRect
- $$if Control.HotSpot
- if (itemHit == ResD_$Control.name$) /* Handle the HotSpot being pressed */
- {
- }
-
- $$endif Control.HotSpot
- $$EndLoop
- $$Loop Control.type = Picture
- $$if Control.NonGraphic
- if (itemHit == ResD_$Control.name$) /* Handle the Picture being pressed */
- {
- }
-
- $$endif Control.NonGraphic
- $$EndLoop
- $$Loop Control.type = Icon
- $$if Control.NonGraphic
- if (itemHit == ResD_$Control.name$) /* Handle the Icon being pressed */
- {
- }
-
- $$endif Control.NonGraphic
- $$EndLoop
- $$Loop Control.type = Sicn
- $$if Control.NonGraphic
- if (itemHit == ResD_$Control.name$) /* Handle the Sicn being pressed */
- {
- }
-
- $$endif Control.NonGraphic
- $$EndLoop
- }
-
- }
- $$endif Option.EXTRAHOOKS
-
- /* ======================================================= */
- /* ======================================================= */
- $$CloseFile
- $$EndLoop
-
-